﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;

namespace bookmeetingroom.Helper
{
    public static class UserHelper
    {
        public static Guid GetCompanyID(this ClaimsPrincipal user)
        {
            var companyid = user.Claims.Where(n => n.Type == ClaimTypes.GroupSid).Select(n => n.Value).FirstOrDefault();

            if (string.IsNullOrEmpty(companyid )) return Guid.Empty;

            return new Guid(companyid);
        }
    }
}
